import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { CustomService } from './custom.service';
import { SelectItem, MenuItem } from 'primeng/primeng';
import { switchMap } from 'rxjs/operators';

@Component({
  templateUrl: './custom.component.html',
  styleUrls: ['./custom.component.scss'],
  providers: [CustomService]
})
export class CustomComponent implements OnInit {
  bizId: number = 0;
  taskListGroupId: number = 0;
  customConfig: any = {};
  items: MenuItem[] = [];
  constructor(
    private router: Router,
    private route: ActivatedRoute,
    private customService: CustomService) {
  }

  ngOnInit() {
    this.bizId = +this.route.snapshot.paramMap.get('bizId');
    this.customService.loadConfigDetail(this.bizId).subscribe(data => {
      this.customConfig = data;
      this.customService.loadTaskListGroup(this.bizId).subscribe(items => this.items = items);
    });

  }

}
